package com.zzzy.doc.vo.document;

import com.zzzy.common.vo.PageParam;
import com.zzzy.doc.common.enums.DocStatusEnum;
import com.zzzy.doc.common.enums.SecretLevelEnum;
import com.zzzy.doc.common.enums.UrgencyEnum;
import com.zzzy.framework.common.annotation.RangeValuesCheck;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

@Data
public class DocPageReq extends PageParam {

    @Schema(description = "发文标题")
    @Length(max = 100, message = "发文标题不能超过100个字符")
    private String subject;

    @Schema(description = "发文字号")
    @Length(max = 50, message = "发文字号不能超过50个字符")
    private String docNo;

    @Schema(description = "紧急程度：普通、紧急、特级")
    @RangeValuesCheck(enumValueRange = UrgencyEnum.class, allowBlank = true, message = "紧急程度填写错误")
    private String urgency;

    @Schema(description = "密级：普通、紧急、特级")
    @RangeValuesCheck(enumValueRange = SecretLevelEnum.class, allowBlank = true, message = "密级填写错误")
    private String secretLevel;

    @Schema(description = "发文单位")
    @Length(max = 255, message = "发文单位不能超过255个字符")
    private String sendUnit;

    @Schema(description = "公文摘要")
    @Length(max = 50, message = "公文摘要不能超过50个字符")
    private String docPrecis;

    @Schema(description = "正文内容")
    @Length(max = 50, message = "正文内容不能超过50个字符")
    private String docText;

    @Schema(description = "公文状态：拟稿、审核修订、会签、领导签发、清稿套红、签章、分发、办结、归档")
    @RangeValuesCheck(enumValueRange = DocStatusEnum.class, allowBlank = true, message = "公文状态填写错误")
    private String status;

    @Schema(description = "印发日期开始")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate beginPrintDate;

    @Schema(description = "印发日期结束")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate endPrintDate;

    @Schema(description = "限办日期开始")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate beginEndDate;

    @Schema(description = "限办日期结束")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate endEndDate;

    @Schema(description = "更新时间开始")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate beginUpdateTime;

    @Schema(description = "更新时间结束")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate endUpdateTime;

    @Schema(description = "排序字段")
    private String orderField;

    @Schema(description = "排序规则（正序：asc，倒序：desc）")
    private String orderRule;
}
